package com.gakj.truck.third.api.service;

import com.gakj.truck.third.api.mapper.ShtCityMapper;
import com.gakj.truck.third.api.mapper.ShtDistrictMapper;
import com.gakj.truck.third.api.mapper.ShtProvinceMapper;
import com.gakj.truck.third.core.domain.area.ShtCity;
import com.gakj.truck.third.core.domain.area.ShtDistrict;
import com.gakj.truck.third.core.domain.area.ShtProvince;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by gc on 2016/5/24.
 */
@Service
public class AreaService {

    @Autowired
    ShtProvinceMapper shtProvinceMapper;

    @Autowired
    ShtCityMapper shtCityMapper;

    @Autowired
    ShtDistrictMapper shtDistrictMapper;


    public List<ShtProvince> getAllProvinces(){
        return shtProvinceMapper.getAll();
    }

    public ShtProvince getProvinceByname(String name){
        return shtProvinceMapper.getProvinceByname(name);
    }

    public List<ShtCity> getAllCitys(){
        return shtCityMapper.getAll();
    }

    public ShtCity getShtCityByname(String name){
        return shtCityMapper.getCityByname(name);
    }

    public List<ShtDistrict> getAllDistricts(){
        return shtDistrictMapper.getAll();
    }

    public ShtDistrict getShtDistrictByname(String name,Integer cid,Integer pid){
        return shtDistrictMapper.getDistrictByname(name,cid,pid);
    }

}
